package com.ruoyi.cooperation.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cooperation.mapper.PwCooperationMapper;
import com.ruoyi.cooperation.domain.PwCooperation;
import com.ruoyi.cooperation.service.IPwCooperationService;

/**
 * 合作加盟表Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-26
 */
@Service
public class PwCooperationServiceImpl implements IPwCooperationService 
{
    @Autowired
    private PwCooperationMapper pwCooperationMapper;

    /**
     * 查询合作加盟表
     * 
     * @param id 合作加盟表主键
     * @return 合作加盟表
     */
    @Override
    public PwCooperation selectPwCooperationById(Long id)
    {
        return pwCooperationMapper.selectPwCooperationById(id);
    }

    /**
     * 查询合作加盟表列表
     * 
     * @param pwCooperation 合作加盟表
     * @return 合作加盟表
     */
    @Override
    public List<PwCooperation> selectPwCooperationList(PwCooperation pwCooperation)
    {
        return pwCooperationMapper.selectPwCooperationList(pwCooperation);
    }

    /**
     * 新增合作加盟表
     * 
     * @param pwCooperation 合作加盟表
     * @return 结果
     */
    @Override
    public int insertPwCooperation(PwCooperation pwCooperation)
    {
        pwCooperation.setCreateTime(DateUtils.getNowDate());
        return pwCooperationMapper.insertPwCooperation(pwCooperation);
    }

    /**
     * 修改合作加盟表
     * 
     * @param pwCooperation 合作加盟表
     * @return 结果
     */
    @Override
    public int updatePwCooperation(PwCooperation pwCooperation)
    {
        pwCooperation.setUpdateTime(DateUtils.getNowDate());
        return pwCooperationMapper.updatePwCooperation(pwCooperation);
    }

    /**
     * 批量删除合作加盟表
     * 
     * @param ids 需要删除的合作加盟表主键
     * @return 结果
     */
    @Override
    public int deletePwCooperationByIds(Long[] ids)
    {
        return pwCooperationMapper.deletePwCooperationByIds(ids);
    }

    /**
     * 删除合作加盟表信息
     * 
     * @param id 合作加盟表主键
     * @return 结果
     */
    @Override
    public int deletePwCooperationById(Long id)
    {
        return pwCooperationMapper.deletePwCooperationById(id);
    }
}
